﻿-- =========================================================================================================
-- Author:		MICHAEL RITACCO
-- Copyright:	2010 MEKHANO GROUP LLC
-- Version:		08/21/2010 1.0
-- =========================================================================================================
CREATE PROCEDURE [flcr].[api_domain_dml_del]
	 (@DOMAIN_UDT AS flcr.DOMAIN_UDT READONLY)

AS
DECLARE @err int

BEGIN TRY
	BEGIN TRAN;
	
	DELETE	[flcr].[DOMAIN] 
	 WHERE	[DOMAIN_ID] IN (SELECT DOMAIN_ID FROM @DOMAIN_UDT)

	DELETE	[flcrTM].[DOMAIN] 
	 WHERE	[DOMAIN_ID] IN (SELECT DOMAIN_ID FROM @DOMAIN_UDT)

	COMMIT TRAN;

END TRY
BEGIN CATCH
	ROLLBACK TRANSACTION;
	EXEC [flcr].[utl_getDBError];
END CATCH